{% load i18n %}
{% load allauth %}
{% load socialaccount %}
{% get_providers as socialaccount_providers %}
{% if socialaccount_providers %}
    {% load allauth socialaccount %}
    {% get_providers as socialaccount_providers %}
    {% if socialaccount_providers %}
      {% if not SOCIALACCOUNT_ONLY %}
        <div class="hr-text">{% trans "or" %}</div>
      {% endif %}
        {% for provider in socialaccount_providers %}
            {% if provider.id == "openid" %}
                {% for brand in provider.get_brands %}
                  {% provider_login_url provider openid=brand.openid_url process=process as href %}
                      <div class="row mt-1 mb-1">
                        <div class="col">
                          <form method="POST" action="{{ href }}">
                            <button class="btn btn-white w-100">
                              {% trans "Log in with" %} {{ brand.name }}
                            </button>
                          </form>
                        </div>
                      </div>
                {% endfor %}
            {% endif %}
            {% provider_login_url provider process=process scope=scope auth_params=auth_params as href %}
            <div class="row mt-1 mb-1">
              <div class="col">
                <form method="POST" action="{{ href }}">
                  {% csrf_token %}
                  <button class="btn btn-white w-100">
                    {% trans "Log in with" %} {{provider.name}}
                  </button>
                </form>
              </div>
            </div>
        {% endfor %}
    {% endif %}
    {% providers_media_js %}
{% elif SOCIALACCOUNT_ONLY %}
  <p> {% trans "Please allow logging in with credentials or set up a third party" %}</p>
{% endif %}
